import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'

import Playing from './views/Playing.vue' 
import Comming from './views/Comming.vue'

Vue.use(Router)

export default new Router({
  /* mode: 'history',
  base: process.env.BASE_URL, */
  routes: [
    {
      path:'/',redirect:"/home"
    },
    {
      path: '/home',
      name: 'home',
      component: Home,
      children: [
          { path:"playing",component: Playing },
          { path:"comming",component:Comming },    
          { path:"",redirect:'playing'}
      ]
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
    },
    {
      path:'/mine/:userId',     //(必选)
      name:"mine",
      //component:Mine    //(必选)
      /* component:function(){
        return import('./views/Mine.vue');
      } */
      component: () => import('./views/Mine.vue')
    },
    {
      path:'/movie/:movieId',
      name:'movie',
      component: ()=>import('./views/Movie.vue')
    },
    {
      path:'/shows/:cinemaId',
      name:'shows',
      component: ()=>import('./views/Shows.vue')
    }
  ]
})
